<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span id="local-6989586621680941890"><span id="local-6989586621680941891"><span id="local-6989586621680941892"><span id="local-6989586621680941893"><span id="local-6989586621680941894"><span id="local-6989586621680941895"><span id="local-6989586621680941896"></span></span></span></span></span></span></span><span>
</span><span id="line-2"></span><span class="hs-comment">-- | Utils for calculating general worst, bound, squeese and free, functions.</span><span>
</span><span id="line-3"></span><span class="hs-comment">--</span><span>
</span><span id="line-4"></span><span class="hs-comment">--   as per: &quot;A Generalized Algorithm for Graph-Coloring Register Allocation&quot;</span><span>
</span><span id="line-5"></span><span class="hs-comment">--           Michael Smith, Normal Ramsey, Glenn Holloway.</span><span>
</span><span id="line-6"></span><span class="hs-comment">--           PLDI 2004</span><span>
</span><span id="line-7"></span><span class="hs-comment">--</span><span>
</span><span id="line-8"></span><span class="hs-comment">--   These general versions are not used in GHC proper because they are too slow.</span><span>
</span><span id="line-9"></span><span class="hs-comment">--   Instead, hand written optimised versions are provided for each architecture</span><span>
</span><span id="line-10"></span><span class="hs-comment">--   in MachRegs*.hs</span><span>
</span><span id="line-11"></span><span class="hs-comment">--</span><span>
</span><span id="line-12"></span><span class="hs-comment">--   This code is here because we can test the architecture specific code against</span><span>
</span><span id="line-13"></span><span class="hs-comment">--   it.</span><span>
</span><span id="line-14"></span><span class="hs-comment">--</span><span>
</span><span id="line-15"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.CmmToAsm.Reg.Graph.Base</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-16"></span><span>        </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#RegClass"><span class="hs-identifier">RegClass</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-17"></span><span>        </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#Reg"><span class="hs-identifier">Reg</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-18"></span><span>        </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#RegSub"><span class="hs-identifier">RegSub</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-19"></span><span>
</span><span id="line-20"></span><span>        </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#worst"><span class="hs-identifier">worst</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-21"></span><span>        </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#bound"><span class="hs-identifier">bound</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-22"></span><span>        </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#squeese"><span class="hs-identifier">squeese</span></a></span><span>
</span><span id="line-23"></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-24"></span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-26"></span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Set.html"><span class="hs-identifier">GHC.Types.Unique.Set</span></a></span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.FM.html"><span class="hs-identifier">GHC.Types.Unique.FM</span></a></span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html"><span class="hs-identifier">GHC.Types.Unique</span></a></span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Monad.html"><span class="hs-identifier">GHC.Utils.Monad</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Utils.Monad.html#concatMapM"><span class="hs-identifier">concatMapM</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-31"></span><span>
</span><span id="line-32"></span><span>
</span><span id="line-33"></span><span class="hs-comment">-- Some basic register classes.</span><span>
</span><span id="line-34"></span><span class="hs-comment">--      These aren't necessarily in 1-to-1 correspondence with the allocatable</span><span>
</span><span id="line-35"></span><span class="hs-comment">--      RegClasses in MachRegs.hs</span><span>
</span><span id="line-36"></span><span class="hs-keyword">data</span><span> </span><span id="RegClass"><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#RegClass"><span class="hs-identifier hs-var">RegClass</span></a></span></span><span>
</span><span id="line-37"></span><span>        </span><span class="hs-comment">-- general purpose regs</span><span>
</span><span id="line-38"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span id="ClassG32"><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#ClassG32"><span class="hs-identifier hs-var">ClassG32</span></a></span></span><span>      </span><span class="hs-comment">-- 32 bit GPRs</span><span>
</span><span id="line-39"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span id="ClassG16"><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#ClassG16"><span class="hs-identifier hs-var">ClassG16</span></a></span></span><span>      </span><span class="hs-comment">-- 16 bit GPRs</span><span>
</span><span id="line-40"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span id="ClassG8"><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#ClassG8"><span class="hs-identifier hs-var">ClassG8</span></a></span></span><span>       </span><span class="hs-comment">-- 8  bit GPRs</span><span>
</span><span id="line-41"></span><span>
</span><span id="line-42"></span><span>        </span><span class="hs-comment">-- floating point regs</span><span>
</span><span id="line-43"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span id="ClassF64"><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#ClassF64"><span class="hs-identifier hs-var">ClassF64</span></a></span></span><span>      </span><span class="hs-comment">-- 64 bit FPRs</span><span>
</span><span id="line-44"></span><span>        </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680941869"><span id="local-6989586621680941871"><span id="local-6989586621680941873"><span class="annot"><span class="annottext">Int -&gt; RegClass -&gt; ShowS
[RegClass] -&gt; ShowS
RegClass -&gt; String
(Int -&gt; RegClass -&gt; ShowS)
-&gt; (RegClass -&gt; String) -&gt; ([RegClass] -&gt; ShowS) -&gt; Show RegClass
forall a.
(Int -&gt; a -&gt; ShowS) -&gt; (a -&gt; String) -&gt; ([a] -&gt; ShowS) -&gt; Show a
showList :: [RegClass] -&gt; ShowS
$cshowList :: [RegClass] -&gt; ShowS
show :: RegClass -&gt; String
$cshow :: RegClass -&gt; String
showsPrec :: Int -&gt; RegClass -&gt; ShowS
$cshowsPrec :: Int -&gt; RegClass -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Show</span></a></span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680941864"><span id="local-6989586621680941866"><span class="annot"><span class="annottext">RegClass -&gt; RegClass -&gt; Bool
(RegClass -&gt; RegClass -&gt; Bool)
-&gt; (RegClass -&gt; RegClass -&gt; Bool) -&gt; Eq RegClass
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: RegClass -&gt; RegClass -&gt; Bool
$c/= :: RegClass -&gt; RegClass -&gt; Bool
== :: RegClass -&gt; RegClass -&gt; Bool
$c== :: RegClass -&gt; RegClass -&gt; Bool
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680941827"><span id="local-6989586621680941829"><span id="local-6989586621680941833"><span id="local-6989586621680941837"><span id="local-6989586621680941839"><span id="local-6989586621680941848"><span id="local-6989586621680941854"><span id="local-6989586621680941861"><span class="annot"><span class="annottext">Int -&gt; RegClass
RegClass -&gt; Int
RegClass -&gt; [RegClass]
RegClass -&gt; RegClass
RegClass -&gt; RegClass -&gt; [RegClass]
RegClass -&gt; RegClass -&gt; RegClass -&gt; [RegClass]
(RegClass -&gt; RegClass)
-&gt; (RegClass -&gt; RegClass)
-&gt; (Int -&gt; RegClass)
-&gt; (RegClass -&gt; Int)
-&gt; (RegClass -&gt; [RegClass])
-&gt; (RegClass -&gt; RegClass -&gt; [RegClass])
-&gt; (RegClass -&gt; RegClass -&gt; [RegClass])
-&gt; (RegClass -&gt; RegClass -&gt; RegClass -&gt; [RegClass])
-&gt; Enum RegClass
forall a.
(a -&gt; a)
-&gt; (a -&gt; a)
-&gt; (Int -&gt; a)
-&gt; (a -&gt; Int)
-&gt; (a -&gt; [a])
-&gt; (a -&gt; a -&gt; [a])
-&gt; (a -&gt; a -&gt; [a])
-&gt; (a -&gt; a -&gt; a -&gt; [a])
-&gt; Enum a
enumFromThenTo :: RegClass -&gt; RegClass -&gt; RegClass -&gt; [RegClass]
$cenumFromThenTo :: RegClass -&gt; RegClass -&gt; RegClass -&gt; [RegClass]
enumFromTo :: RegClass -&gt; RegClass -&gt; [RegClass]
$cenumFromTo :: RegClass -&gt; RegClass -&gt; [RegClass]
enumFromThen :: RegClass -&gt; RegClass -&gt; [RegClass]
$cenumFromThen :: RegClass -&gt; RegClass -&gt; [RegClass]
enumFrom :: RegClass -&gt; [RegClass]
$cenumFrom :: RegClass -&gt; [RegClass]
fromEnum :: RegClass -&gt; Int
$cfromEnum :: RegClass -&gt; Int
toEnum :: Int -&gt; RegClass
$ctoEnum :: Int -&gt; RegClass
pred :: RegClass -&gt; RegClass
$cpred :: RegClass -&gt; RegClass
succ :: RegClass -&gt; RegClass
$csucc :: RegClass -&gt; RegClass
</span><a href="../../base/src/GHC.Enum.html#Enum"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Enum</span></a></span></span></span></span></span></span></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-45"></span><span>
</span><span id="line-46"></span><span>
</span><span id="line-47"></span><span class="hs-comment">-- | A register of some class</span><span>
</span><span id="line-48"></span><span class="hs-keyword">data</span><span> </span><span id="Reg"><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#Reg"><span class="hs-identifier hs-var">Reg</span></a></span></span><span>
</span><span id="line-49"></span><span>        </span><span class="hs-comment">-- a register of some class</span><span>
</span><span id="line-50"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span id="Reg"><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#Reg"><span class="hs-identifier hs-var">Reg</span></a></span></span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#RegClass"><span class="hs-identifier hs-type">RegClass</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-51"></span><span>
</span><span id="line-52"></span><span>        </span><span class="hs-comment">-- a sub-component of one of the other regs</span><span>
</span><span id="line-53"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span id="RegSub"><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#RegSub"><span class="hs-identifier hs-var">RegSub</span></a></span></span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#RegSub"><span class="hs-identifier hs-type">RegSub</span></a></span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#Reg"><span class="hs-identifier hs-type">Reg</span></a></span><span>
</span><span id="line-54"></span><span>        </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680941812"><span id="local-6989586621680941814"><span id="local-6989586621680941822"><span class="annot"><span class="annottext">Int -&gt; Reg -&gt; ShowS
[Reg] -&gt; ShowS
Reg -&gt; String
(Int -&gt; Reg -&gt; ShowS)
-&gt; (Reg -&gt; String) -&gt; ([Reg] -&gt; ShowS) -&gt; Show Reg
forall a.
(Int -&gt; a -&gt; ShowS) -&gt; (a -&gt; String) -&gt; ([a] -&gt; ShowS) -&gt; Show a
showList :: [Reg] -&gt; ShowS
$cshowList :: [Reg] -&gt; ShowS
show :: Reg -&gt; String
$cshow :: Reg -&gt; String
showsPrec :: Int -&gt; Reg -&gt; ShowS
$cshowsPrec :: Int -&gt; Reg -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Show</span></a></span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680941804"><span id="local-6989586621680941810"><span class="annot"><span class="annottext">Reg -&gt; Reg -&gt; Bool
(Reg -&gt; Reg -&gt; Bool) -&gt; (Reg -&gt; Reg -&gt; Bool) -&gt; Eq Reg
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: Reg -&gt; Reg -&gt; Bool
$c/= :: Reg -&gt; Reg -&gt; Bool
== :: Reg -&gt; Reg -&gt; Bool
$c== :: Reg -&gt; Reg -&gt; Bool
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-55"></span><span>
</span><span id="line-56"></span><span>
</span><span id="line-57"></span><span class="hs-comment">-- | so we can put regs in UniqSets</span><span>
</span><span id="line-58"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Uniquable"><span class="hs-identifier hs-type">Uniquable</span></a></span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#Reg"><span class="hs-identifier hs-type">Reg</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-59"></span><span>        </span><span id="local-6989586621680941786"><span class="annot"><span class="annottext">getUnique :: Reg -&gt; Unique
</span><a href="GHC.Types.Unique.html#getUnique"><span class="hs-identifier hs-var hs-var hs-var hs-var">getUnique</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#Reg"><span class="hs-identifier hs-type">Reg</span></a></span><span> </span><span id="local-6989586621680941784"><span class="annot"><span class="annottext">RegClass
</span><a href="#local-6989586621680941784"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621680941783"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680941783"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-60"></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Unique
</span><a href="GHC.Types.Unique.html#mkRegSingleUnique"><span class="hs-identifier hs-var">mkRegSingleUnique</span></a></span><span>
</span><span id="line-61"></span><span>         </span><span class="annot"><span class="annottext">(Int -&gt; Unique) -&gt; Int -&gt; Unique
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">RegClass -&gt; Int
forall a. Enum a =&gt; a -&gt; Int
</span><a href="../../base/src/GHC.Enum.html#fromEnum"><span class="hs-identifier hs-var">fromEnum</span></a></span><span> </span><span class="annot"><span class="annottext">RegClass
</span><a href="#local-6989586621680941784"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1000</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680941783"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-62"></span><span>
</span><span id="line-63"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.html#getUnique"><span class="hs-identifier hs-var">getUnique</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#RegSub"><span class="hs-identifier hs-type">RegSub</span></a></span><span> </span><span id="local-6989586621680941778"><span class="annot"><span class="annottext">RegSub
</span><a href="#local-6989586621680941778"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#Reg"><span class="hs-identifier hs-type">Reg</span></a></span><span> </span><span id="local-6989586621680941777"><span class="annot"><span class="annottext">RegClass
</span><a href="#local-6989586621680941777"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621680941776"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680941776"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-64"></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Unique
</span><a href="GHC.Types.Unique.html#mkRegSubUnique"><span class="hs-identifier hs-var">mkRegSubUnique</span></a></span><span>
</span><span id="line-65"></span><span>         </span><span class="annot"><span class="annottext">(Int -&gt; Unique) -&gt; Int -&gt; Unique
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">RegSub -&gt; Int
forall a. Enum a =&gt; a -&gt; Int
</span><a href="../../base/src/GHC.Enum.html#fromEnum"><span class="hs-identifier hs-var">fromEnum</span></a></span><span> </span><span class="annot"><span class="annottext">RegSub
</span><a href="#local-6989586621680941778"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">10000</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">RegClass -&gt; Int
forall a. Enum a =&gt; a -&gt; Int
</span><a href="../../base/src/GHC.Enum.html#fromEnum"><span class="hs-identifier hs-var">fromEnum</span></a></span><span> </span><span class="annot"><span class="annottext">RegClass
</span><a href="#local-6989586621680941777"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1000</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680941776"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-66"></span><span>
</span><span id="line-67"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.html#getUnique"><span class="hs-identifier hs-var">getUnique</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#RegSub"><span class="hs-identifier hs-type">RegSub</span></a></span><span> </span><span class="annot"><span class="annottext">RegSub
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#RegSub"><span class="hs-identifier hs-type">RegSub</span></a></span><span> </span><span class="annot"><span class="annottext">RegSub
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Reg
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-68"></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Unique
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;RegArchBase.getUnique: can't have a sub-reg of a sub-reg.&quot;</span></span><span>
</span><span id="line-69"></span><span>
</span><span id="line-70"></span><span>
</span><span id="line-71"></span><span class="hs-comment">-- | A subcomponent of another register</span><span>
</span><span id="line-72"></span><span class="hs-keyword">data</span><span> </span><span id="RegSub"><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#RegSub"><span class="hs-identifier hs-var">RegSub</span></a></span></span><span>
</span><span id="line-73"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span id="SubL16"><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#SubL16"><span class="hs-identifier hs-var">SubL16</span></a></span></span><span>        </span><span class="hs-comment">-- lowest 16 bits</span><span>
</span><span id="line-74"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span id="SubL8"><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#SubL8"><span class="hs-identifier hs-var">SubL8</span></a></span></span><span>         </span><span class="hs-comment">-- lowest  8 bits</span><span>
</span><span id="line-75"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span id="SubL8H"><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#SubL8H"><span class="hs-identifier hs-var">SubL8H</span></a></span></span><span>        </span><span class="hs-comment">-- second lowest 8 bits</span><span>
</span><span id="line-76"></span><span>        </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680941765"><span id="local-6989586621680941767"><span id="local-6989586621680941769"><span class="annot"><span class="annottext">Int -&gt; RegSub -&gt; ShowS
[RegSub] -&gt; ShowS
RegSub -&gt; String
(Int -&gt; RegSub -&gt; ShowS)
-&gt; (RegSub -&gt; String) -&gt; ([RegSub] -&gt; ShowS) -&gt; Show RegSub
forall a.
(Int -&gt; a -&gt; ShowS) -&gt; (a -&gt; String) -&gt; ([a] -&gt; ShowS) -&gt; Show a
showList :: [RegSub] -&gt; ShowS
$cshowList :: [RegSub] -&gt; ShowS
show :: RegSub -&gt; String
$cshow :: RegSub -&gt; String
showsPrec :: Int -&gt; RegSub -&gt; ShowS
$cshowsPrec :: Int -&gt; RegSub -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Show</span></a></span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680941732"><span id="local-6989586621680941734"><span id="local-6989586621680941738"><span id="local-6989586621680941741"><span id="local-6989586621680941743"><span id="local-6989586621680941751"><span id="local-6989586621680941757"><span id="local-6989586621680941763"><span class="annot"><span class="annottext">Int -&gt; RegSub
RegSub -&gt; Int
RegSub -&gt; [RegSub]
RegSub -&gt; RegSub
RegSub -&gt; RegSub -&gt; [RegSub]
RegSub -&gt; RegSub -&gt; RegSub -&gt; [RegSub]
(RegSub -&gt; RegSub)
-&gt; (RegSub -&gt; RegSub)
-&gt; (Int -&gt; RegSub)
-&gt; (RegSub -&gt; Int)
-&gt; (RegSub -&gt; [RegSub])
-&gt; (RegSub -&gt; RegSub -&gt; [RegSub])
-&gt; (RegSub -&gt; RegSub -&gt; [RegSub])
-&gt; (RegSub -&gt; RegSub -&gt; RegSub -&gt; [RegSub])
-&gt; Enum RegSub
forall a.
(a -&gt; a)
-&gt; (a -&gt; a)
-&gt; (Int -&gt; a)
-&gt; (a -&gt; Int)
-&gt; (a -&gt; [a])
-&gt; (a -&gt; a -&gt; [a])
-&gt; (a -&gt; a -&gt; [a])
-&gt; (a -&gt; a -&gt; a -&gt; [a])
-&gt; Enum a
enumFromThenTo :: RegSub -&gt; RegSub -&gt; RegSub -&gt; [RegSub]
$cenumFromThenTo :: RegSub -&gt; RegSub -&gt; RegSub -&gt; [RegSub]
enumFromTo :: RegSub -&gt; RegSub -&gt; [RegSub]
$cenumFromTo :: RegSub -&gt; RegSub -&gt; [RegSub]
enumFromThen :: RegSub -&gt; RegSub -&gt; [RegSub]
$cenumFromThen :: RegSub -&gt; RegSub -&gt; [RegSub]
enumFrom :: RegSub -&gt; [RegSub]
$cenumFrom :: RegSub -&gt; [RegSub]
fromEnum :: RegSub -&gt; Int
$cfromEnum :: RegSub -&gt; Int
toEnum :: Int -&gt; RegSub
$ctoEnum :: Int -&gt; RegSub
pred :: RegSub -&gt; RegSub
$cpred :: RegSub -&gt; RegSub
succ :: RegSub -&gt; RegSub
$csucc :: RegSub -&gt; RegSub
</span><a href="../../base/src/GHC.Enum.html#Enum"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Enum</span></a></span></span></span></span></span></span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680941713"><span id="local-6989586621680941715"><span id="local-6989586621680941718"><span id="local-6989586621680941721"><span id="local-6989586621680941724"><span id="local-6989586621680941726"><span id="local-6989586621680941728"><span class="annot"><span class="annottext">Eq RegSub
Eq RegSub
-&gt; (RegSub -&gt; RegSub -&gt; Ordering)
-&gt; (RegSub -&gt; RegSub -&gt; Bool)
-&gt; (RegSub -&gt; RegSub -&gt; Bool)
-&gt; (RegSub -&gt; RegSub -&gt; Bool)
-&gt; (RegSub -&gt; RegSub -&gt; Bool)
-&gt; (RegSub -&gt; RegSub -&gt; RegSub)
-&gt; (RegSub -&gt; RegSub -&gt; RegSub)
-&gt; Ord RegSub
RegSub -&gt; RegSub -&gt; Bool
RegSub -&gt; RegSub -&gt; Ordering
RegSub -&gt; RegSub -&gt; RegSub
forall a.
Eq a
-&gt; (a -&gt; a -&gt; Ordering)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; a)
-&gt; (a -&gt; a -&gt; a)
-&gt; Ord a
min :: RegSub -&gt; RegSub -&gt; RegSub
$cmin :: RegSub -&gt; RegSub -&gt; RegSub
max :: RegSub -&gt; RegSub -&gt; RegSub
$cmax :: RegSub -&gt; RegSub -&gt; RegSub
&gt;= :: RegSub -&gt; RegSub -&gt; Bool
$c&gt;= :: RegSub -&gt; RegSub -&gt; Bool
&gt; :: RegSub -&gt; RegSub -&gt; Bool
$c&gt; :: RegSub -&gt; RegSub -&gt; Bool
&lt;= :: RegSub -&gt; RegSub -&gt; Bool
$c&lt;= :: RegSub -&gt; RegSub -&gt; Bool
&lt; :: RegSub -&gt; RegSub -&gt; Bool
$c&lt; :: RegSub -&gt; RegSub -&gt; Bool
compare :: RegSub -&gt; RegSub -&gt; Ordering
$ccompare :: RegSub -&gt; RegSub -&gt; Ordering
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Ord</span></span></span></span></span></span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680941708"><span id="local-6989586621680941710"><span class="annot"><span class="annottext">RegSub -&gt; RegSub -&gt; Bool
(RegSub -&gt; RegSub -&gt; Bool)
-&gt; (RegSub -&gt; RegSub -&gt; Bool) -&gt; Eq RegSub
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: RegSub -&gt; RegSub -&gt; Bool
$c/= :: RegSub -&gt; RegSub -&gt; Bool
== :: RegSub -&gt; RegSub -&gt; Bool
$c== :: RegSub -&gt; RegSub -&gt; Bool
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-77"></span><span>
</span><span id="line-78"></span><span>
</span><span id="line-79"></span><span class="hs-comment">-- | Worst case displacement</span><span>
</span><span id="line-80"></span><span class="hs-comment">--</span><span>
</span><span id="line-81"></span><span class="hs-comment">--      a node N of classN has some number of neighbors,</span><span>
</span><span id="line-82"></span><span class="hs-comment">--      all of which are from classC.</span><span>
</span><span id="line-83"></span><span class="hs-comment">--</span><span>
</span><span id="line-84"></span><span class="hs-comment">--      (worst neighbors classN classC) is the maximum number of potential</span><span>
</span><span id="line-85"></span><span class="hs-comment">--      colors for N that can be lost by coloring its neighbors.</span><span>
</span><span id="line-86"></span><span class="hs-comment">--</span><span>
</span><span id="line-87"></span><span class="hs-comment">-- This should be hand coded/cached for each particular architecture,</span><span>
</span><span id="line-88"></span><span class="hs-comment">--      because the compute time is very long..</span><span>
</span><span id="line-89"></span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#worst"><span class="hs-identifier hs-type">worst</span></a></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#RegClass"><span class="hs-identifier hs-type">RegClass</span></a></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Set.html#UniqSet"><span class="hs-identifier hs-type">UniqSet</span></a></span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#Reg"><span class="hs-identifier hs-type">Reg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-90"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#Reg"><span class="hs-identifier hs-type">Reg</span></a></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Set.html#UniqSet"><span class="hs-identifier hs-type">UniqSet</span></a></span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#Reg"><span class="hs-identifier hs-type">Reg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-91"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#RegClass"><span class="hs-identifier hs-type">RegClass</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#RegClass"><span class="hs-identifier hs-type">RegClass</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-92"></span><span>
</span><span id="line-93"></span><span id="worst"><span class="annot"><span class="annottext">worst :: (RegClass -&gt; UniqSet Reg)
-&gt; (Reg -&gt; UniqSet Reg) -&gt; Int -&gt; RegClass -&gt; RegClass -&gt; Int
</span><a href="GHC.CmmToAsm.Reg.Graph.Base.html#worst"><span class="hs-identifier hs-var hs-var">worst</span></a></span></span><span> </span><span id="local-6989586621680941707"><span class="annot"><span class="annottext">RegClass -&gt; UniqSet Reg
</span><a href="#local-6989586621680941707"><span class="hs-identifier hs-var">regsOfClass</span></a></span></span><span> </span><span id="local-6989586621680941706"><span class="annot"><span class="annottext">Reg -&gt; UniqSet Reg
</span><a href="#local-6989586621680941706"><span class="hs-identifier hs-var">regAlias</span></a></span></span><span> </span><span id="local-6989586621680941705"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680941705"><span class="hs-identifier hs-var">neighbors</span></a></span></span><span> </span><span id="local-6989586621680941704"><span class="annot"><span class="annottext">RegClass
</span><a href="#local-6989586621680941704"><span class="hs-identifier hs-var">classN</span></a></span></span><span> </span><span id="local-6989586621680941703"><span class="annot"><span class="annottext">RegClass
</span><a href="#local-6989586621680941703"><span class="hs-identifier hs-var">classC</span></a></span></span><span>
</span><span id="line-94"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span>  </span><span id="local-6989586621680941702"><span class="annot"><span class="annottext">regAliasS :: UniqSet Reg -&gt; UniqSet Reg
</span><a href="#local-6989586621680941702"><span class="hs-identifier hs-var hs-var">regAliasS</span></a></span></span><span> </span><span id="local-6989586621680941701"><span class="annot"><span class="annottext">UniqSet Reg
</span><a href="#local-6989586621680941701"><span class="hs-identifier hs-var">regs</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[UniqSet Reg] -&gt; UniqSet Reg
forall a. [UniqSet a] -&gt; UniqSet a
</span><a href="GHC.Types.Unique.Set.html#unionManyUniqSets"><span class="hs-identifier hs-var">unionManyUniqSets</span></a></span><span>
</span><span id="line-95"></span><span>                        </span><span class="annot"><span class="annottext">([UniqSet Reg] -&gt; UniqSet Reg) -&gt; [UniqSet Reg] -&gt; UniqSet Reg
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(Reg -&gt; UniqSet Reg) -&gt; [Reg] -&gt; [UniqSet Reg]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Reg -&gt; UniqSet Reg
</span><a href="#local-6989586621680941706"><span class="hs-identifier hs-var">regAlias</span></a></span><span>
</span><span id="line-96"></span><span>                        </span><span class="annot"><span class="annottext">([Reg] -&gt; [UniqSet Reg]) -&gt; [Reg] -&gt; [UniqSet Reg]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSet Reg -&gt; [Reg]
forall elt. UniqSet elt -&gt; [elt]
</span><a href="GHC.Types.Unique.Set.html#nonDetEltsUniqSet"><span class="hs-identifier hs-var">nonDetEltsUniqSet</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSet Reg
</span><a href="#local-6989586621680941701"><span class="hs-identifier hs-var">regs</span></a></span><span>
</span><span id="line-97"></span><span>                        </span><span class="hs-comment">-- This is non-deterministic but we do not</span><span>
</span><span id="line-98"></span><span>                        </span><span class="hs-comment">-- currently support deterministic code-generation.</span><span>
</span><span id="line-99"></span><span>                        </span><span class="hs-comment">-- See Note [Unique Determinism and code generation]</span><span>
</span><span id="line-100"></span><span>
</span><span id="line-101"></span><span>        </span><span class="hs-comment">-- all the regs in classes N, C</span><span>
</span><span id="line-102"></span><span>        </span><span id="local-6989586621680941698"><span class="annot"><span class="annottext">regsN :: UniqSet Reg
</span><a href="#local-6989586621680941698"><span class="hs-identifier hs-var hs-var">regsN</span></a></span></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RegClass -&gt; UniqSet Reg
</span><a href="#local-6989586621680941707"><span class="hs-identifier hs-var">regsOfClass</span></a></span><span> </span><span class="annot"><span class="annottext">RegClass
</span><a href="#local-6989586621680941704"><span class="hs-identifier hs-var">classN</span></a></span><span>
</span><span id="line-103"></span><span>        </span><span id="local-6989586621680941697"><span class="annot"><span class="annottext">regsC :: UniqSet Reg
</span><a href="#local-6989586621680941697"><span class="hs-identifier hs-var hs-var">regsC</span></a></span></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RegClass -&gt; UniqSet Reg
</span><a href="#local-6989586621680941707"><span class="hs-identifier hs-var">regsOfClass</span></a></span><span> </span><span class="annot"><span class="annottext">RegClass
</span><a href="#local-6989586621680941703"><span class="hs-identifier hs-var">classC</span></a></span><span>
</span><span id="line-104"></span><span>
</span><span id="line-105"></span><span>        </span><span class="hs-comment">-- all the possible subsets of c which have size &lt; m</span><span>
</span><span id="line-106"></span><span>        </span><span id="local-6989586621680941692"><span class="annot"><span class="annottext">regsS :: [UniqSet Reg]
</span><a href="#local-6989586621680941692"><span class="hs-identifier hs-var hs-var">regsS</span></a></span></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(UniqSet Reg -&gt; Bool) -&gt; [UniqSet Reg] -&gt; [UniqSet Reg]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621680941691"><span class="annot"><span class="annottext">UniqSet Reg
</span><a href="#local-6989586621680941691"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">UniqSet Reg -&gt; Int
forall a. UniqSet a -&gt; Int
</span><a href="GHC.Types.Unique.Set.html#sizeUniqSet"><span class="hs-identifier hs-var">sizeUniqSet</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSet Reg
</span><a href="#local-6989586621680941691"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-107"></span><span>                                     </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">UniqSet Reg -&gt; Int
forall a. UniqSet a -&gt; Int
</span><a href="GHC.Types.Unique.Set.html#sizeUniqSet"><span class="hs-identifier hs-var">sizeUniqSet</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSet Reg
</span><a href="#local-6989586621680941691"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680941705"><span class="hs-identifier hs-var">neighbors</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-108"></span><span>                        </span><span class="annot"><span class="annottext">([UniqSet Reg] -&gt; [UniqSet Reg]) -&gt; [UniqSet Reg] -&gt; [UniqSet Reg]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSet Reg -&gt; [UniqSet Reg]
forall a. Uniquable a =&gt; UniqSet a -&gt; [UniqSet a]
</span><a href="GHC.CmmToAsm.Reg.Graph.Base.html#powersetLS"><span class="hs-identifier hs-var">powersetLS</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSet Reg
</span><a href="#local-6989586621680941697"><span class="hs-identifier hs-var">regsC</span></a></span><span>
</span><span id="line-109"></span><span>
</span><span id="line-110"></span><span>        </span><span class="hs-comment">-- for each of the subsets of C, the regs which conflict</span><span>
</span><span id="line-111"></span><span>        </span><span class="hs-comment">-- with posiblities for N</span><span>
</span><span id="line-112"></span><span>        </span><span id="local-6989586621680941686"><span class="annot"><span class="annottext">regsS_conflict :: [UniqSet Reg]
</span><a href="#local-6989586621680941686"><span class="hs-identifier hs-var hs-var">regsS_conflict</span></a></span></span><span>
</span><span id="line-113"></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(UniqSet Reg -&gt; UniqSet Reg) -&gt; [UniqSet Reg] -&gt; [UniqSet Reg]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621680941685"><span class="annot"><span class="annottext">UniqSet Reg
</span><a href="#local-6989586621680941685"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">UniqSet Reg -&gt; UniqSet Reg -&gt; UniqSet Reg
forall a. UniqSet a -&gt; UniqSet a -&gt; UniqSet a
</span><a href="GHC.Types.Unique.Set.html#intersectUniqSets"><span class="hs-identifier hs-var">intersectUniqSets</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSet Reg
</span><a href="#local-6989586621680941698"><span class="hs-identifier hs-var">regsN</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UniqSet Reg -&gt; UniqSet Reg
</span><a href="#local-6989586621680941702"><span class="hs-identifier hs-var">regAliasS</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSet Reg
</span><a href="#local-6989586621680941685"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[UniqSet Reg]
</span><a href="#local-6989586621680941692"><span class="hs-identifier hs-var">regsS</span></a></span><span>
</span><span id="line-114"></span><span>
</span><span id="line-115"></span><span>  </span><span class="hs-keyword">in</span><span>    </span><span class="annot"><span class="annottext">[Int] -&gt; Int
forall (t :: * -&gt; *) a. (Foldable t, Ord a) =&gt; t a -&gt; a
</span><a href="../../base/src/Data.Foldable.html#maximum"><span class="hs-identifier hs-var">maximum</span></a></span><span> </span><span class="annot"><span class="annottext">([Int] -&gt; Int) -&gt; [Int] -&gt; Int
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(UniqSet Reg -&gt; Int) -&gt; [UniqSet Reg] -&gt; [Int]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSet Reg -&gt; Int
forall a. UniqSet a -&gt; Int
</span><a href="GHC.Types.Unique.Set.html#sizeUniqSet"><span class="hs-identifier hs-var">sizeUniqSet</span></a></span><span> </span><span class="annot"><span class="annottext">([UniqSet Reg] -&gt; [Int]) -&gt; [UniqSet Reg] -&gt; [Int]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[UniqSet Reg]
</span><a href="#local-6989586621680941686"><span class="hs-identifier hs-var">regsS_conflict</span></a></span><span>
</span><span id="line-116"></span><span>
</span><span id="line-117"></span><span>
</span><span id="line-118"></span><span class="hs-comment">-- | For a node N of classN and neighbors of classesC</span><span>
</span><span id="line-119"></span><span class="hs-comment">--      (bound classN classesC) is the maximum number of potential</span><span>
</span><span id="line-120"></span><span class="hs-comment">--      colors for N that can be lost by coloring its neighbors.</span><span>
</span><span id="line-121"></span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#bound"><span class="hs-identifier hs-type">bound</span></a></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#RegClass"><span class="hs-identifier hs-type">RegClass</span></a></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Set.html#UniqSet"><span class="hs-identifier hs-type">UniqSet</span></a></span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#Reg"><span class="hs-identifier hs-type">Reg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-122"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#Reg"><span class="hs-identifier hs-type">Reg</span></a></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Set.html#UniqSet"><span class="hs-identifier hs-type">UniqSet</span></a></span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#Reg"><span class="hs-identifier hs-type">Reg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-123"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#RegClass"><span class="hs-identifier hs-type">RegClass</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#RegClass"><span class="hs-identifier hs-type">RegClass</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-124"></span><span>
</span><span id="line-125"></span><span id="bound"><span class="annot"><span class="annottext">bound :: (RegClass -&gt; UniqSet Reg)
-&gt; (Reg -&gt; UniqSet Reg) -&gt; RegClass -&gt; [RegClass] -&gt; Int
</span><a href="GHC.CmmToAsm.Reg.Graph.Base.html#bound"><span class="hs-identifier hs-var hs-var">bound</span></a></span></span><span> </span><span id="local-6989586621680941682"><span class="annot"><span class="annottext">RegClass -&gt; UniqSet Reg
</span><a href="#local-6989586621680941682"><span class="hs-identifier hs-var">regsOfClass</span></a></span></span><span> </span><span id="local-6989586621680941681"><span class="annot"><span class="annottext">Reg -&gt; UniqSet Reg
</span><a href="#local-6989586621680941681"><span class="hs-identifier hs-var">regAlias</span></a></span></span><span> </span><span id="local-6989586621680941680"><span class="annot"><span class="annottext">RegClass
</span><a href="#local-6989586621680941680"><span class="hs-identifier hs-var">classN</span></a></span></span><span> </span><span id="local-6989586621680941679"><span class="annot"><span class="annottext">[RegClass]
</span><a href="#local-6989586621680941679"><span class="hs-identifier hs-var">classesC</span></a></span></span><span>
</span><span id="line-126"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span>  </span><span id="local-6989586621680941678"><span class="annot"><span class="annottext">regAliasS :: UniqFM key Reg -&gt; UniqSet Reg
</span><a href="#local-6989586621680941678"><span class="hs-identifier hs-var hs-var">regAliasS</span></a></span></span><span> </span><span id="local-6989586621680941677"><span class="annot"><span class="annottext">UniqFM key Reg
</span><a href="#local-6989586621680941677"><span class="hs-identifier hs-var">regs</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[UniqSet Reg] -&gt; UniqSet Reg
forall a. [UniqSet a] -&gt; UniqSet a
</span><a href="GHC.Types.Unique.Set.html#unionManyUniqSets"><span class="hs-identifier hs-var">unionManyUniqSets</span></a></span><span>
</span><span id="line-127"></span><span>                        </span><span class="annot"><span class="annottext">([UniqSet Reg] -&gt; UniqSet Reg) -&gt; [UniqSet Reg] -&gt; UniqSet Reg
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(Reg -&gt; UniqSet Reg) -&gt; [Reg] -&gt; [UniqSet Reg]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Reg -&gt; UniqSet Reg
</span><a href="#local-6989586621680941681"><span class="hs-identifier hs-var">regAlias</span></a></span><span>
</span><span id="line-128"></span><span>                        </span><span class="annot"><span class="annottext">([Reg] -&gt; [UniqSet Reg]) -&gt; [Reg] -&gt; [UniqSet Reg]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">UniqFM key Reg -&gt; [Reg]
forall key elt. UniqFM key elt -&gt; [elt]
</span><a href="GHC.Types.Unique.FM.html#nonDetEltsUFM"><span class="hs-identifier hs-var">nonDetEltsUFM</span></a></span><span> </span><span class="annot"><span class="annottext">UniqFM key Reg
</span><a href="#local-6989586621680941677"><span class="hs-identifier hs-var">regs</span></a></span><span>
</span><span id="line-129"></span><span>                        </span><span class="hs-comment">-- See Note [Unique Determinism and code generation]</span><span>
</span><span id="line-130"></span><span>
</span><span id="line-131"></span><span>        </span><span id="local-6989586621680941675"><span class="annot"><span class="annottext">regsC_aliases :: UniqSet Reg
</span><a href="#local-6989586621680941675"><span class="hs-identifier hs-var hs-var">regsC_aliases</span></a></span></span><span>
</span><span id="line-132"></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[UniqSet Reg] -&gt; UniqSet Reg
forall a. [UniqSet a] -&gt; UniqSet a
</span><a href="GHC.Types.Unique.Set.html#unionManyUniqSets"><span class="hs-identifier hs-var">unionManyUniqSets</span></a></span><span>
</span><span id="line-133"></span><span>                </span><span class="annot"><span class="annottext">([UniqSet Reg] -&gt; UniqSet Reg) -&gt; [UniqSet Reg] -&gt; UniqSet Reg
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(RegClass -&gt; UniqSet Reg) -&gt; [RegClass] -&gt; [UniqSet Reg]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UniqFM Reg Reg -&gt; UniqSet Reg
forall {key}. UniqFM key Reg -&gt; UniqSet Reg
</span><a href="#local-6989586621680941678"><span class="hs-identifier hs-var">regAliasS</span></a></span><span> </span><span class="annot"><span class="annottext">(UniqFM Reg Reg -&gt; UniqSet Reg)
-&gt; (RegClass -&gt; UniqFM Reg Reg) -&gt; RegClass -&gt; UniqSet Reg
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSet Reg -&gt; UniqFM Reg Reg
forall a. UniqSet a -&gt; UniqFM a a
</span><a href="GHC.Types.Unique.Set.html#getUniqSet"><span class="hs-identifier hs-var">getUniqSet</span></a></span><span> </span><span class="annot"><span class="annottext">(UniqSet Reg -&gt; UniqFM Reg Reg)
-&gt; (RegClass -&gt; UniqSet Reg) -&gt; RegClass -&gt; UniqFM Reg Reg
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">RegClass -&gt; UniqSet Reg
</span><a href="#local-6989586621680941682"><span class="hs-identifier hs-var">regsOfClass</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[RegClass]
</span><a href="#local-6989586621680941679"><span class="hs-identifier hs-var">classesC</span></a></span><span>
</span><span id="line-134"></span><span>
</span><span id="line-135"></span><span>        </span><span id="local-6989586621680941672"><span class="annot"><span class="annottext">overlap :: UniqSet Reg
</span><a href="#local-6989586621680941672"><span class="hs-identifier hs-var hs-var">overlap</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqSet Reg -&gt; UniqSet Reg -&gt; UniqSet Reg
forall a. UniqSet a -&gt; UniqSet a -&gt; UniqSet a
</span><a href="GHC.Types.Unique.Set.html#intersectUniqSets"><span class="hs-identifier hs-var">intersectUniqSets</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RegClass -&gt; UniqSet Reg
</span><a href="#local-6989586621680941682"><span class="hs-identifier hs-var">regsOfClass</span></a></span><span> </span><span class="annot"><span class="annottext">RegClass
</span><a href="#local-6989586621680941680"><span class="hs-identifier hs-var">classN</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">UniqSet Reg
</span><a href="#local-6989586621680941675"><span class="hs-identifier hs-var">regsC_aliases</span></a></span><span>
</span><span id="line-136"></span><span>
</span><span id="line-137"></span><span>   </span><span class="hs-keyword">in</span><span>   </span><span class="annot"><span class="annottext">UniqSet Reg -&gt; Int
forall a. UniqSet a -&gt; Int
</span><a href="GHC.Types.Unique.Set.html#sizeUniqSet"><span class="hs-identifier hs-var">sizeUniqSet</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSet Reg
</span><a href="#local-6989586621680941672"><span class="hs-identifier hs-var">overlap</span></a></span><span>
</span><span id="line-138"></span><span>
</span><span id="line-139"></span><span>
</span><span id="line-140"></span><span class="hs-comment">-- | The total squeese on a particular node with a list of neighbors.</span><span>
</span><span id="line-141"></span><span class="hs-comment">--</span><span>
</span><span id="line-142"></span><span class="hs-comment">--   A version of this should be constructed for each particular architecture,</span><span>
</span><span id="line-143"></span><span class="hs-comment">--   possibly including uses of bound, so that alised registers don't get</span><span>
</span><span id="line-144"></span><span class="hs-comment">--   counted twice, as per the paper.</span><span>
</span><span id="line-145"></span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#squeese"><span class="hs-identifier hs-type">squeese</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#RegClass"><span class="hs-identifier hs-type">RegClass</span></a></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Set.html#UniqSet"><span class="hs-identifier hs-type">UniqSet</span></a></span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#Reg"><span class="hs-identifier hs-type">Reg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-146"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#Reg"><span class="hs-identifier hs-type">Reg</span></a></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Set.html#UniqSet"><span class="hs-identifier hs-type">UniqSet</span></a></span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#Reg"><span class="hs-identifier hs-type">Reg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-147"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#RegClass"><span class="hs-identifier hs-type">RegClass</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#RegClass"><span class="hs-identifier hs-type">RegClass</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-148"></span><span>
</span><span id="line-149"></span><span id="squeese"><span class="annot"><span class="annottext">squeese :: (RegClass -&gt; UniqSet Reg)
-&gt; (Reg -&gt; UniqSet Reg) -&gt; RegClass -&gt; [(Int, RegClass)] -&gt; Int
</span><a href="GHC.CmmToAsm.Reg.Graph.Base.html#squeese"><span class="hs-identifier hs-var hs-var">squeese</span></a></span></span><span> </span><span id="local-6989586621680941671"><span class="annot"><span class="annottext">RegClass -&gt; UniqSet Reg
</span><a href="#local-6989586621680941671"><span class="hs-identifier hs-var">regsOfClass</span></a></span></span><span> </span><span id="local-6989586621680941670"><span class="annot"><span class="annottext">Reg -&gt; UniqSet Reg
</span><a href="#local-6989586621680941670"><span class="hs-identifier hs-var">regAlias</span></a></span></span><span> </span><span id="local-6989586621680941669"><span class="annot"><span class="annottext">RegClass
</span><a href="#local-6989586621680941669"><span class="hs-identifier hs-var">classN</span></a></span></span><span> </span><span id="local-6989586621680941668"><span class="annot"><span class="annottext">[(Int, RegClass)]
</span><a href="#local-6989586621680941668"><span class="hs-identifier hs-var">countCs</span></a></span></span><span>
</span><span id="line-150"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Int] -&gt; Int
forall (t :: * -&gt; *) a. (Foldable t, Num a) =&gt; t a -&gt; a
</span><a href="../../base/src/Data.Foldable.html#sum"><span class="hs-identifier hs-var">sum</span></a></span><span>
</span><span id="line-151"></span><span>        </span><span class="annot"><span class="annottext">([Int] -&gt; Int) -&gt; [Int] -&gt; Int
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">((Int, RegClass) -&gt; Int) -&gt; [(Int, RegClass)] -&gt; [Int]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621680941666"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680941666"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680941665"><span class="annot"><span class="annottext">RegClass
</span><a href="#local-6989586621680941665"><span class="hs-identifier hs-var">classC</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(RegClass -&gt; UniqSet Reg)
-&gt; (Reg -&gt; UniqSet Reg) -&gt; Int -&gt; RegClass -&gt; RegClass -&gt; Int
</span><a href="GHC.CmmToAsm.Reg.Graph.Base.html#worst"><span class="hs-identifier hs-var">worst</span></a></span><span> </span><span class="annot"><span class="annottext">RegClass -&gt; UniqSet Reg
</span><a href="#local-6989586621680941671"><span class="hs-identifier hs-var">regsOfClass</span></a></span><span> </span><span class="annot"><span class="annottext">Reg -&gt; UniqSet Reg
</span><a href="#local-6989586621680941670"><span class="hs-identifier hs-var">regAlias</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680941666"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">RegClass
</span><a href="#local-6989586621680941669"><span class="hs-identifier hs-var">classN</span></a></span><span> </span><span class="annot"><span class="annottext">RegClass
</span><a href="#local-6989586621680941665"><span class="hs-identifier hs-var">classC</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-152"></span><span>        </span><span class="annot"><span class="annottext">([(Int, RegClass)] -&gt; [Int]) -&gt; [(Int, RegClass)] -&gt; [Int]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[(Int, RegClass)]
</span><a href="#local-6989586621680941668"><span class="hs-identifier hs-var">countCs</span></a></span><span>
</span><span id="line-153"></span><span>
</span><span id="line-154"></span><span>
</span><span id="line-155"></span><span class="hs-comment">-- | powerset (for lists)</span><span>
</span><span id="line-156"></span><span id="local-6989586621680941928"><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#powersetL"><span class="hs-identifier hs-type">powersetL</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621680941928"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621680941928"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span class="hs-special">]</span></span><span>
</span><span id="line-157"></span><span id="powersetL"><span class="annot"><span class="annottext">powersetL :: forall a. [a] -&gt; [[a]]
</span><a href="GHC.CmmToAsm.Reg.Graph.Base.html#powersetL"><span class="hs-identifier hs-var hs-var">powersetL</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; [[a]]) -&gt; [a] -&gt; [[a]]
forall (m :: * -&gt; *) a b. Monad m =&gt; (a -&gt; m [b]) -&gt; [a] -&gt; m [b]
</span><a href="GHC.Utils.Monad.html#concatMapM"><span class="hs-identifier hs-var">concatMapM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621680941661"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680941661"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span class="hs-special">[</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680941661"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">]</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-158"></span><span>
</span><span id="line-159"></span><span>
</span><span id="line-160"></span><span class="hs-comment">-- | powersetLS (list of sets)</span><span>
</span><span id="line-161"></span><span id="local-6989586621680941941"><span class="annot"><a href="GHC.CmmToAsm.Reg.Graph.Base.html#powersetLS"><span class="hs-identifier hs-type">powersetLS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Uniquable"><span class="hs-identifier hs-type">Uniquable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680941941"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Set.html#UniqSet"><span class="hs-identifier hs-type">UniqSet</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680941941"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Unique.Set.html#UniqSet"><span class="hs-identifier hs-type">UniqSet</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680941941"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-162"></span><span id="powersetLS"><span class="annot"><span class="annottext">powersetLS :: forall a. Uniquable a =&gt; UniqSet a -&gt; [UniqSet a]
</span><a href="GHC.CmmToAsm.Reg.Graph.Base.html#powersetLS"><span class="hs-identifier hs-var hs-var">powersetLS</span></a></span></span><span> </span><span id="local-6989586621680941658"><span class="annot"><span class="annottext">UniqSet a
</span><a href="#local-6989586621680941658"><span class="hs-identifier hs-var">s</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([a] -&gt; UniqSet a) -&gt; [[a]] -&gt; [UniqSet a]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; UniqSet a
forall a. Uniquable a =&gt; [a] -&gt; UniqSet a
</span><a href="GHC.Types.Unique.Set.html#mkUniqSet"><span class="hs-identifier hs-var">mkUniqSet</span></a></span><span> </span><span class="annot"><span class="annottext">([[a]] -&gt; [UniqSet a]) -&gt; [[a]] -&gt; [UniqSet a]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; [[a]]
forall a. [a] -&gt; [[a]]
</span><a href="GHC.CmmToAsm.Reg.Graph.Base.html#powersetL"><span class="hs-identifier hs-var">powersetL</span></a></span><span> </span><span class="annot"><span class="annottext">([a] -&gt; [[a]]) -&gt; [a] -&gt; [[a]]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSet a -&gt; [a]
forall elt. UniqSet elt -&gt; [elt]
</span><a href="GHC.Types.Unique.Set.html#nonDetEltsUniqSet"><span class="hs-identifier hs-var">nonDetEltsUniqSet</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSet a
</span><a href="#local-6989586621680941658"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-163"></span><span>  </span><span class="hs-comment">-- See Note [Unique Determinism and code generation]</span><span>
</span><span id="line-164"></span></pre></body></html>